package lab02.Test25;

import java.util.Scanner;

/**
 * Created by lx on 2017/11/15.
 */
public class Test {
    public static void main(String[] args) {
            int num1 = 0;
            int num2 = 0;
            Scanner scanner = new Scanner(System.in);

            try {
                System.out.println("请输入被除数:");
                num1 = scanner.nextInt();

                System.out.println("请输入除数:");
                num2 = scanner.nextInt();

            }catch (ArithmeticException e){
                System.out.println("输入的类型不合法");
            } catch (Exception e) {

            }

            if(num2 == 0) {
                System.out.println("除数为0！！！");
            } else {
                System.out.println(num1 + " / " + num2 + " = " + (num1 / num2));
            }
        }
    }

